package com.tedu.openmedical.begiveback.controller;


import com.tedu.openmedical.base.response.JsonResult;
import com.tedu.openmedical.begiveback.pojo.BeGiveback;
import com.tedu.openmedical.begiveback.service.BeGivebackService;
import com.tedu.openmedical.binfopatientinfo.pojo.entity.BinfoPatientInfo;
import com.tedu.openmedical.binfopatientinfo.service.BinfoPatientInfoService;
import com.tedu.openmedical.brregister.pojo.entity.BrRegister;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 病案借阅归还表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2024-08-11
 */
@RestController
@RequestMapping("/be/giveback")
@Slf4j
@CrossOrigin
public class BeGivebackController {
    @Autowired
    private BeGivebackService givebackService;
    //selectRegisterAll:查询所有病案借阅登记表
    @GetMapping("/select/selectAll")
    public JsonResult selectAll(){
        log.debug("开始执行selectAll方法");
        List<BeGiveback> beGivebacks = givebackService.list(null);
        return JsonResult.ok(beGivebacks);
    }
    //selectOne：根据讲师id查询
    @GetMapping("/select/selectOne/{id}")
    public JsonResult selectOne(@PathVariable String id){

        BeGiveback beGiveback = givebackService.getById(id);
        return JsonResult.ok(beGiveback);
    }
}

